<?php

$str = "a\nb\nc\nd\n";
$arr = explode("\n",$str);
print_r($arr);
